﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Krile.Data
{
    public partial class DSDataArgSetUI : Krilib.Control.SDataArgSetUI
    {
        public override void Accepted()
        {
            gSearchDataBase.Arguments = searchText.Text;
            gSearchDataBase.SearchType = (DefaultSearchDataBase.SearchTypes)searchTypeSelector.SelectedIndex;
        }

        //argument
        public string SearchArgument
        {
            get { return searchText.Text; }
            set { searchText.Text = value; }
        }

        public Data.DefaultSearchDataBase.SearchTypes SearchType
        {
            get { return (DefaultSearchDataBase.SearchTypes)searchTypeSelector.SelectedIndex; }
            set { searchTypeSelector.SelectedIndex = (int)value; }
        }

        Data.DefaultSearchDataBase gSearchDataBase;
        public DSDataArgSetUI(Data.DefaultSearchDataBase gsd)
        {
            InitializeComponent();
            gSearchDataBase = gsd;
            searchText.Text = gSearchDataBase.Arguments;
            searchTypeSelector.SelectedIndex = (int)gSearchDataBase.SearchType;
        }
    }
}
